package com.esri.core.map;

import java.util.LinkedHashMap;
import java.util.Map;
import org.codehaus.jackson.JsonParser;
import org.codehaus.jackson.JsonToken;

/* loaded from: classes.dex */
public class CodedValueDomain extends Domain {
    private static final long serialVersionUID = 1;
    private Map<String, String> a;

    public CodedValueDomain(String str, Map<String, String> map) {
        this.domainName = str;
        this.a = map;
    }

    public CodedValueDomain() {
    }

    public Map<String, String> getCodedValues() {
        return this.a;
    }

    @Override // com.esri.core.map.Domain
    public String toString() {
        return "CodedValueDomain: [ domainName:" + this.domainName + " codedValues:" + this.a + " ]";
    }

    public static CodedValueDomain fromJson(JsonParser jsonParser) throws Exception {
        CodedValueDomain codedValueDomain = new CodedValueDomain();
        codedValueDomain.a = new LinkedHashMap();
        if (jsonParser.getCurrentToken() != JsonToken.START_ARRAY) {
            return null;
        }
        while (jsonParser.nextToken() != JsonToken.END_ARRAY) {
            String str = null;
            String str2 = null;
            while (jsonParser.nextToken() != JsonToken.END_OBJECT) {
                String currentName = jsonParser.getCurrentName();
                jsonParser.nextToken();
                if (currentName.equals("name")) {
                    str2 = jsonParser.getText();
                } else if (currentName.equals("code")) {
                    str = jsonParser.getText();
                }
            }
            codedValueDomain.a.put(str, str2);
        }
        return codedValueDomain;
    }

    @Override // com.esri.core.map.Domain
    public int hashCode() {
        int hashCode = super.hashCode() * 31;
        Map<String, String> map = this.a;
        return hashCode + (map == null ? 0 : map.hashCode());
    }

    @Override // com.esri.core.map.Domain
    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (super.equals(obj) && getClass() == obj.getClass()) {
            CodedValueDomain codedValueDomain = (CodedValueDomain) obj;
            Map<String, String> map = this.a;
            if (map == null) {
                if (codedValueDomain.a != null) {
                    return false;
                }
            } else if (!map.equals(codedValueDomain.a)) {
                return false;
            }
            return true;
        }
        return false;
    }
}
